package com.cheng.service;

import com.cheng.spring.ApplicationContext;

/**
 * @author chengjunjie
 * @date 2025-10-10
 */

public class Test {
    public static void main(String[] args) {

        ApplicationContext applicationContext = new ApplicationContext(AppConfig.class);

//        // 测试单例，打印地址是否是同一个对象
//        System.out.println(applicationContext.getBean("userService"));
//        System.out.println(applicationContext.getBean("userService"));
//
//        // 测试依赖注入
//        System.out.println(applicationContext.getBean("orderService"));

        // 测试AOP
        UserInterface userService = (UserInterface) applicationContext.getBean("userService");
        userService.test();

    }
}
